package com.card.demo;

import java.util.Scanner;

public class main {
    public static void main(String[] args) {
        GoldCard c1=new GoldCard("101101101","肖怡琴","12345678901",0);
        SilverCard c2=new SilverCard("102102102","小王","12345678902",0);
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入存入的金额："+"\n"
                +"1.普卡"+"\n"+"2.金卡:金额大于5000"+"\n"+"3.银卡:金额大于2000"+"\n");
        double m=scan.nextDouble();
        createCard(m,m>2000?c1:c2);
    }
    public static void createCard(double m,card c)
    {
        c.addMoney(m);
        System.out.println("您已成功创建消费卡!");
        System.out.println("请输入消费金额：");
        Scanner scan1=new Scanner(System.in);
        c.shopMoney(scan1.nextDouble());
        System.out.println("尊敬的"+c.getName()+"您已消费成功！");
        System.out.println("当前余额为："+c.getMoney());
    }
}
